﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

//用于判断玩家处于哪个相机区域的点（实质是一个很小的碰撞体）
public class CameraPoint : MonoBehaviour
{
    public CameraController GetCameraController() => Camera.main.GetComponentInChildren<CameraController>();

    private void OnTriggerStay2D(Collider2D collision)
    {
        CameraConfiner cameraConfiner = collision.GetComponent<CameraConfiner>();
        if(cameraConfiner!=null)
        {
            GetCameraController().SetConfiner(cameraConfiner.PolygonCollider);
        }
    }
}
